package oving3;

public class Person {
	String name;
	Person mother;
	Person father;
	Person[] children;
	public Person(){
		
	}
	public Person(String navn, Person mother,Person father, int c ){
		name=navn;
		this.mother=mother;
		this.father=father;
		children= new Person[c];
	}
	public boolean isMotherOf(Person p){
		if(children!=null){
			for(int i=0;i<this.children.length;i++){
				if(this.children[i]==p&&p.mother==this){
					return true;
				}
			}
		}
		return false;
	}
	public boolean isFatherOf(Person p){
		if(children!=null){
			for(int i=0;i<this.children.length;i++){
				if(this.children[i]==p&&p.father==this){
					return true;
					
				}
			}
		}
		return false;
		
	}
	public boolean isSiblingOf(Person p){
		if(p!=this){
			if(p.mother==this.mother&&p.father==this.father){
				return true;
			}
		}
		return false;
	}
	public boolean isHalfSiblingOf(Person p){
		
		if(p.mother==mother^p.father==father){
			return true;
		}
		return false;
	}
}
